<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header">
        <div class="layui-logo">
            <img src="__TPL_RESOURCE_BACKEND__/images/logo.png"/>
            <cite>&nbspMonkey CMS</cite>
        </div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
<!--            <li class="layui-nav-item" lay-unselect>-->
<!--                <a ew-event="message" title="消息">-->
<!--                    <i class="layui-icon layui-icon-notice"></i>-->
<!--                    <span class="layui-badge-dot"></span>-->
<!--                </a>-->
<!--            </li>-->
<!--            <li class="layui-nav-item" lay-unselect>-->
<!--                <a ew-event="note" title="便签"><i class="layui-icon layui-icon-note"></i></a>-->
<!--            </li>-->
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-event="lockScreen" data-url="{{:url('Index/lock')}}" title="锁屏"><i class="layui-icon layui-icon-password"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a>
                    <img src="__TPL_RESOURCE_BACKEND__/images/head.jpg" class="layui-nav-img">
                    <cite>{{:session('nickname')}}</cite>
                </a>
                <dl class="layui-nav-child">
<!--                    <dd lay-unselect><a ew-href="page/template/user-info.html">个人中心</a></dd>-->
                    <dd lay-unselect><a ew-event="psw" data-url="{{:url('Admin/editPassword')}}">修改密码</a></dd>
                    <hr>
                    <dd lay-unselect><a ew-event="logout" data-url="{{:url('Login/logout')}}">退出</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a data-url="{{:url('Index/theme')}}" ew-event="theme" title="主题"><i class="layui-icon layui-icon-more-vertical"></i></a>
            </li>
        </ul>
    </div>

    <!-- 侧边栏 -->
    <div class="layui-side">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree arrow2" lay-filter="admin-side-nav" lay-shrink="_all">
                {{volist name="menu_list" id="item"}}
                <li class="layui-nav-item">
                    <a><i class="layui-icon {{$item.icon}}"></i>&emsp;<cite>{{$item.name}}</cite></a>
                    <dl class="layui-nav-child">
                        {{volist name="item.list" id="menu"}}
                        <dd><a lay-href="{{:url($menu.url)}}">{{$menu.name}}</a></dd>
                        {{/volist}}
                    </dl>
                </li>
                {{/volist}}
            </ul>
        </div>
    </div>

    <!-- 主体部分 -->
    <div class="layui-body"></div>
    <!-- 底部 -->
    <div class="layui-footer layui-text">
        copyright © 2023 monkey-cms all rights reserved.
        <span class="pull-right">Version 3.1.8</span>
    </div>

    <audio autoplay="autoplay" id="withdraw_autoplay">
    </audio>

    <audio autoplay="autoplay" id="recharge_autoplay">
    </audio>
</div>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="__TPL_RESOURCE_BACKEND__/libs/layui/layui.js"></script>
<script type="text/javascript" src="__TPL_RESOURCE_BACKEND__/js/common.js"></script>

<script>
    layui.use(['index'], function () {
        var $ = layui.jquery;
        var index = layui.index;

        // 默认加载主页
        index.loadHome({
            menuPath: "{{:url('Order/index')}}",
            menuName: '<i class="layui-icon layui-icon-home"></i>'
        });

        //检测是否有待处理的提现申请
        function ajaxWithdraw(){
            $.ajax({
                url: "{{:url('Index/getWithdrawCount')}}",
                type: 'post',
                data: {},
                success: function (res) {
                    if(res.data.count > 0){
                        $('#withdraw_autoplay').attr('src', '__TPL_RESOURCE_BACKEND__/voice/withdraw.mp3');
                    }
                }, error: function (err) {
                    console.log(err)
                }
            });
        }

        setInterval(ajaxWithdraw,10000);

        //检测是否有待处理的充值申请
        function ajaxRecharge(){
            $.ajax({
                url: "{{:url('Index/getRechargeCount')}}",
                type: 'post',
                data: {},
                success: function (res) {
                    if(res.data.count > 0){
                        $('#recharge_autoplay').attr('src', '__TPL_RESOURCE_BACKEND__/voice/recharge.mp3');
                    }
                }, error: function (err) {
                    console.log(err)
                }
            });
        }

        setInterval(ajaxRecharge,15000);
    });
</script>

</body>
</html>
